function checkAllLesson(callbackFunction) {
	var mat_lesson1 = (localStorage.getItem("estudia_mat_lesson1") != 0);
	var mat_lesson2 = (localStorage.getItem("estudia_mat_lesson2") != 0);
	var fis_lesson1 = (localStorage.getItem("estudia_fis_lesson1") != 0);
	var fis_lesson2 = (localStorage.getItem("estudia_fis_lesson2") != 0);
	var fis_lesson3 = (localStorage.getItem("estudia_fis_lesson3") != 0);
	var bio_lesson1 = (localStorage.getItem("estudia_bio_lesson1") != 0);
	var bio_lesson2 = (localStorage.getItem("estudia_bio_lesson2") != 0);
	var bio_lesson3 = (localStorage.getItem("estudia_bio_lesson3") != 0);

	var flag = (mat_lesson1 && mat_lesson2 && fis_lesson1 && fis_lesson2 && fis_lesson3 && bio_lesson1 && bio_lesson2 && bio_lesson3);
		
	if ( callbackFunction ) {
		callbackFunction (flag);
	}
}

function checkAllQuiz(callbackFunction) {
	var mat_quiz1 = (localStorage.getItem("estudia_mat_quiz1") != 0);
	var mat_quiz2 = (localStorage.getItem("estudia_mat_quiz2") != 0);
	var fis_quiz1 = (localStorage.getItem("estudia_fis_quiz1") != 0);
	var fis_quiz2 = (localStorage.getItem("estudia_fis_quiz2") != 0);
	var fis_quiz3 = (localStorage.getItem("estudia_fis_quiz3") != 0);
	var bio_quiz1 = (localStorage.getItem("estudia_bio_quiz1") != 0);
	var bio_quiz2 = (localStorage.getItem("estudia_bio_quiz2") != 0);
	var bio_quiz3 = (localStorage.getItem("estudia_bio_quiz3") != 0);

	var flag = (mat_quiz1 && mat_quiz2 && fis_quiz1 && fis_quiz2 && fis_quiz3 && bio_quiz1 && bio_quiz2 && bio_quiz3);
		
	if ( callbackFunction ) {
		callbackFunction (flag);
	}
}

function checkALesson(course, callbackFunction) {
	var flag;
	
	if (course == "mat") {
		var mat_lesson1 = (localStorage.getItem("estudia_mat_lesson1") != 0);
		var mat_lesson2 = (localStorage.getItem("estudia_mat_lesson2") != 0);
		
		flag = (mat_lesson1 && mat_lesson2);
	} else if (course == "fis") {
		var fis_lesson1 = (localStorage.getItem("estudia_fis_lesson1") != 0);
		var fis_lesson2 = (localStorage.getItem("estudia_fis_lesson2") != 0);
		var fis_lesson3 = (localStorage.getItem("estudia_fis_lesson3") != 0);
		
		flag = (fis_lesson1 && fis_lesson2 && fis_lesson3);
	} else if (course == "bio") {
		var bio_lesson1 = (localStorage.getItem("estudia_bio_lesson1") != 0);
		var bio_lesson2 = (localStorage.getItem("estudia_bio_lesson2") != 0);
		var bio_lesson3 = (localStorage.getItem("estudia_bio_lesson3") != 0);
		
		flag = (bio_lesson1 && bio_lesson2 && bio_lesson3);
	} else {
		flag = false;
	}
	
	if ( callbackFunction ) {
		callbackFunction (flag);
	}
	
}		

function checkAQuiz(course, callbackFunction) {
	var flag;
	
	if (course == "mat") {
		var mat_quiz1 = (localStorage.getItem("estudia_mat_quiz1") != 0);
		var mat_quiz2 = (localStorage.getItem("estudia_mat_quiz2") != 0);
		
		flag = (mat_quiz1 && mat_quiz2);
	} else if (course == "fis") {
		var fis_quiz1 = (localStorage.getItem("estudia_fis_quiz1") != 0);
		var fis_quiz2 = (localStorage.getItem("estudia_fis_quiz2") != 0);
		var fis_quiz3 = (localStorage.getItem("estudia_fis_quiz3") != 0);
		
		flag = (fis_quiz1 && fis_quiz2 && fis_quiz3);
	} else if (course == "bio") {
		var bio_quiz1 = (localStorage.getItem("estudia_bio_quiz1") != 0);
		var bio_quiz2 = (localStorage.getItem("estudia_bio_quiz2") != 0);
		var bio_quiz3 = (localStorage.getItem("estudia_bio_quiz3") != 0);
		
		flag = (bio_quiz1 && bio_quiz2 && bio_quiz3);
	} else {
		flag = false;
	}
	
	if ( callbackFunction ) {
		callbackFunction (flag);
	}
	
}

function checkCumLaude(callbackFunction) {
	var mat_quiz1 = (parseInt(localStorage.getItem("estudia_mat_quiz1")) >= 80);
	var mat_quiz2 = (parseInt(localStorage.getItem("estudia_mat_quiz2")) >= 80);
	var fis_quiz1 = (parseInt(localStorage.getItem("estudia_fis_quiz1")) >= 80);
	var fis_quiz2 = (parseInt(localStorage.getItem("estudia_fis_quiz2")) >= 80);
	var fis_quiz3 = (parseInt(localStorage.getItem("estudia_fis_quiz3")) >= 80);
	var bio_quiz1 = (parseInt(localStorage.getItem("estudia_bio_quiz1")) >= 80);
	var bio_quiz2 = (parseInt(localStorage.getItem("estudia_bio_quiz2")) >= 80);
	var bio_quiz3 = (parseInt(localStorage.getItem("estudia_bio_quiz3")) >= 80);

	var flag = (mat_quiz1 && mat_quiz2 && fis_quiz1 && fis_quiz2 && fis_quiz3 && bio_quiz1 && bio_quiz2 && bio_quiz3);
	
	if ( callbackFunction ) {
		callbackFunction (flag);
	}
}

function checkSaviour(callbackFunction) {
	var b01 = (parseInt(localStorage.getItem("estudia_achievment_b01")) != 0);
	var b02 = (parseInt(localStorage.getItem("estudia_achievment_b02")) != 0);
	var b03 = (parseInt(localStorage.getItem("estudia_achievment_b03")) != 0);
	var b04 = (parseInt(localStorage.getItem("estudia_achievment_b04")) != 0);
	var b05 = (parseInt(localStorage.getItem("estudia_achievment_b05")) != 0);
	var b06 = (parseInt(localStorage.getItem("estudia_achievment_b06")) != 0);
	var b07 = (parseInt(localStorage.getItem("estudia_achievment_b07")) != 0);
	var b08 = (parseInt(localStorage.getItem("estudia_achievment_b08")) != 0);
	var b09 = (parseInt(localStorage.getItem("estudia_achievment_b09")) != 0);
	var b10 = (parseInt(localStorage.getItem("estudia_achievment_b10")) != 0);
	
	var flag = (b01 && b02 && b03 && b04 && b05 && b06 && b07 && b08 && b09 && b10);
	
	if ( callbackFunction ) {
		callbackFunction (flag);
	}
}